import React from "react";
import store from "../../redux/store";
import {
	addAction,
	jianAction,
	asyncAddAction,
} from "../../redux/reducers/countReducer";
export default function Reduxtwo() {
	let { count, zan } = store.getState();
	return (
		<div>
			<h1> 当前的count数据:{count}</h1>
			<button
				onClick={() => {
					store.dispatch(addAction(1));
				}}
			>
				+1
			</button>
			<button
				onClick={() => {
					store.dispatch(jianAction(1));
				}}
			>
				-1
			</button>
			<button
				onClick={() => {
					store.dispatch(asyncAddAction(10));
				}}
			>
				异步+10
			</button>
		</div>
	);
}
